from fastapi import FastAPI
import asyncio
import time

from config.logger_config import logger

app = FastAPI()


@app.get('/hello')
def hello2():
    logger.debug(f"hello2 api {time.time()}")
    time.sleep(3)
    return f'Hello2, World! {time.time()}'


@app.get('/')
async def hello():
    logger.debug(f"hello api {time.time()}")
    await asyncio.sleep(3)
    return f'Hello, World! {time.time()}'


if __name__ == '__main__':
    import uvicorn
    uvicorn.run(app, host="127.0.0.1", port=5600)